% include('header.html')
% setdefault('user_status',{0:u'预定',1:u"正常",2:u"停机",3:u"销户",4:u"到期"})
% setdefault('sexs',{0:u'女',1:u'男'})

    <div class="jumbotron">
      <div class="container lbanner">
        <h2>账号管理</h2>
        <p></p>
<!--         <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more &raquo;</a></p> -->
      </div>
    </div>

    <div class="container">


        <table class="table ">
                <thead>
                    <tr>
                        <th colspan="6"> 基本信息</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>姓名</td>
                        <td>{{customer['realname']}}</td>
                        <td>证件</td>
                        <td>{{customer['idcard']}}</td>
                        <td>昵称</td>
                        <td>{{customer['customer_name']}}</td>                 
                    </tr>
                    <tr>
                        <td>Email</td>
                        <td>{{customer['email']}}</td>
                        <td>性别</td>
                        <td>{{sexs[customer['sex']]}}</td>
                        <td>电话</td>
                        <td>{{customer['mobile']}}</td>
                    </tr>      
                    <tr>
                        <td>注册时间</td>
                        <td>{{customer['create_time']}}</td>
                        <td>最后更新</td>
                        <td>{{customer['update_time']}}</td> 
                        <td>地址</td>
                        <td>{{customer['address']}}</td>
                                           
                    </tr>                                                                                         
            </tbody>
        </table>
        
        <table class="table table-striped ">
            <thead>
                <tr>
                    <th colspan="9"> 账号信息</th>
                </tr>
            </thead>
            <tbody>
            <tr class="active">
                <th>账号</th>
                <th>资费</th>
                <th>状态</th>
                <th>到期</th>
                <th>余额</th>
                <th>时长</th>
                <th>流量</th>
                <th></th>
            </tr>            
            % for user in accounts:
            <tr>
                <td>{{user['account_number']}}</a></td>
                <td>{{get_product(user['product_id']).get('product_name','')}}</td>
                <td>{{user_status[user['status']]}}</td>
                <td>{{user['expire_date']}}</td>
                <td>{{utils.fen2yuan(user['balance'])}} 元</td>
                <td>{{utils.sec2hour(user['time_length'])}} 小时</td>
                <td>{{utils.kb2mb(user['flow_length'])}} M</td>
                <td>
                    <a href="/password?account_number={{user['account_number']}}">修改密码</a>
                </td>
            </tr>
            % end
            </tbody>
        </table>  
    </div>


% include('footer.html')